{% extends "dash/dashboard.html" %}

{% load dash_filters %}

{% block menuOptionsSelected %}
    <ul class="menu-options">
        <li class="menu-item"><a href="/dash/dashboard/">Dashboard</a></li>
        <li class="menu-item"><a href="/dash/logbook/">Logbook</a></li>
        <li class="menu-item"><a href="/dash/topicos/">Topicos</a></li>
    </ul>
{% endblock menuOptionsSelected %}


{% block dashboard %}
    <div class="item-messages">
        {% for message in messages %}
            <p class="message">{{ message }}</p>
        {% endfor %}
    </div>
    <div class="dashboard-list-items">
        {% for item in recomendaciones %}
            <div class="item-content">
                <div class="item-header">
                    <div class="item-topico item-topico-{{ item.topico|unicode|split:" "|first|lower }}" title="{{ item.topico|unicode|split:" "|first }}"></div>
                    <div class="item-nombre"><a href="/items/item/{{ item.id }}">{{ item }}</a></div>
                    <div class="item-score">
                        <img src="/mymedia/images/dashboard-content-item-header-score.png" class="item-score-image" alt="Score">
                        {{ item.persona_set.count }}
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="item-body">
                    <div class="item-image" title="Imagen ilustrativa del item">
                        {% if item.mis_imagenes.count %}
                            <img src="{{ item.first_image }}" alt="Score">
                        {% else %}
                            <img src="/mymedia/images/298.png" alt="Score">
                        {% endif %}
                    </div>
                    <div class="item-descripcion">
                        Recomendaste este item a
                        <ul>
                            {% for recomendation in user.recomendaciones_enviadas.all %}
                                {% if item == recomendation.item %}
                                    <li class="recomendacion-destino"><a href="/dash/logbook/{{ recomendation.user_destino.id }}">{{ recomendation.user_destino.first_name }} {{ recomendation.user_destino.last_name }}</a> el {{ recomendation.fecha }}</li>
                                {% endif %}
                            {% endfor %}
                        </ul>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="item-footer"></div>
                </div>
        {% endfor %}
    </div>
{% endblock dashboard %}
